package vashion.azeroth.cart.obj;

import lombok.Getter;
import lombok.Setter;
import vashion.azeroth.core.item.pojo.ItemDO;

public class CartItemDO {

	/**
	 * 购物车ID
	 * */
	private @Setter @Getter Long cartId;

	/**
	 * 买家ID
	 * 
	 * */
	private @Setter @Getter Long memberId;

	/**
	 * 商品ID
	 * */
	private @Setter @Getter Long itemId;

	/**
	 * 卖家ID
	 * */
	private @Setter @Getter Long userId;// 卖家Id（暂时先留在这里）

	/**
	 * 商品规格ID
	 * */
	private @Setter @Getter Long skuId;

	/**
	 * SKU名称
	 * 
	 * */
	private @Setter @Getter String skuName;

	/**
	 * 商品数量
	 * */
	private @Setter @Getter Integer quantity;

	/**
	 * 状态
	 * 
	 * */
	private @Setter @Getter Integer status;

	/**
	 * 贴子ID
	 * 
	 * */
	private @Setter @Getter Long publishFileId;

	/**
	 * 商品名称
	 * 
	 * */
	private @Setter @Getter String title;

	/**
	 * 商品图片
	 * 
	 * */
	private @Setter @Getter String pic;

	/**
	 * 商品价格
	 * 
	 * **/
	private @Setter @Getter Long price;

	/**
	 * 商品优惠价格
	 * 
	 * 
	 * */
	private @Setter @Getter Long promotionPrice;

	/**
	 * 商品VIP价格
	 * 
	 * */
	private @Setter @Getter Long vipPrice;

	/**
	 * 商品库存
	 * 
	 * **/
	private @Setter @Getter Long stock;

	private Long totalPrice;

	public Long getTotalPrice() {

		Long totalPrice = 0L;

		if (quantity == null || quantity == 0) {

			return totalPrice;
		}
		if (vipPrice == null || vipPrice == 0) {

			totalPrice = price * quantity;

		} else {

			totalPrice = vipPrice * quantity;
		}

		return totalPrice;
	}

}
